{% block sw_product_packaging_form %}
<div class="sw-product-packaging-form">
    <p class="sw-product-packaging-form__description">
        {{ $tc('sw-product.packagingForm.description') }}
    </p>

    <!-- @deprecated tag:v6.8.0 - <sw-container> will be removed -->
    <sw-container
        v-if="false"
        columns="1fr 1fr 1fr"
        gap="0px 30px"
    >
        <!-- @deprecated tag:v6.8.0 - block will be removed -->
        {% block sw_product_packaging_form_width_field %}
        {% endblock %}

        <!-- @deprecated tag:v6.8.0 - block will be removed -->
        {% block sw_product_packaging_form_height_field %}
        {% endblock %}

        <!-- @deprecated tag:v6.8.0 - block will be removed -->
        {% block sw_product_settings_form_length_field %}
        {% endblock %}
    </sw-container>

    <sw-container
        columns="1fr 1fr 1fr"
        gap="0px 32px"
    >
        <!-- @deprecated tag:v6.8.0 - block will be removed -->
        {% block sw_product_settings_form_weight_field %}
        {% endblock %}

        {% block sw_product_price_form_purchase_unit_field %}
        <sw-inherit-wrapper
            v-show="showSettingPackaging"
            v-model:value="product.purchaseUnit"
            :has-parent="!!parentProduct.id"
            :inherited-value="parentProduct.purchaseUnit"
        >
            <template #content="props">

                <mt-number-field
                    class="sw-product-packaging-form__purchase-unit-field"
                    :is-inheritance-field="props.isInheritField"
                    :is-inherited="props.isInherited"
                    number-type="float"
                    allow-empty
                    :min="0"
                    :digits="3"
                    :error="productPurchaseUnitError"
                    :label="$tc('sw-product.priceForm.labelPurchaseUnit')"
                    :disabled="props.isInherited || !allowEdit"
                    :placeholder="$tc('sw-product.packagingForm.placeholderSellingUnit')"
                    :help-text="$tc('sw-product.packagingForm.helpTextSellingUnit')"
                    :model-value="props.currentValue"
                    @update:model-value="props.updateCurrentValue"
                    @inheritance-restore="props.restoreInheritance"
                    @inheritance-remove="props.removeInheritance"
                />

            </template>
        </sw-inherit-wrapper>
        {% endblock %}

        {% block sw_product_price_form_unit_field %}
        <sw-inherit-wrapper
            v-show="showSettingPackaging"
            v-model:value="product.unitId"
            :has-parent="!!parentProduct.id"
            :label="$tc('sw-product.packagingForm.labelProductUnit')"
            :inherited-value="parentProduct.unitId"
        >
            <template #content="{ currentValue, updateCurrentValue, isInherited }">

                <sw-entity-single-select
                    :key="isInherited"
                    :value="currentValue"
                    entity="unit"
                    :disabled="isInherited || !allowEdit"
                    class="sw-select-product__select_unit"
                    pointer="product.unit"
                    :placeholder="$tc('sw-product.packagingForm.placeholderProductUnit')"
                    show-clearable-button
                    @update:value="updateCurrentValue"
                />

            </template>
        </sw-inherit-wrapper>
        {% endblock %}

        {% block sw_product_price_form_reference_unit_field %}
        <sw-inherit-wrapper
            v-show="showSettingPackaging"
            v-model:value="product.referenceUnit"
            :has-parent="!!parentProduct.id"
            :inherited-value="parentProduct.referenceUnit"
        >
            <template #content="props">

                <mt-number-field
                    class="sw-product-packaging-form__reference-unit-field"
                    :map-inheritance="props"
                    number-type="float"
                    allow-empty
                    :min="0"
                    :digits="3"
                    :error="productReferenceUnitError"
                    :disabled="props.isInherited || !allowEdit"
                    :placeholder="$tc('sw-product.packagingForm.placeholderBasicUnit')"
                    :label="$tc('sw-product.priceForm.labelReferenceUnit')"
                    :model-value="props.currentValue"
                    :help-text="$tc('sw-product.packagingForm.helpTextBasicUnit')"
                    @update:model-value="props.updateCurrentValue"
                />

            </template>
        </sw-inherit-wrapper>
        {% endblock %}
    </sw-container>

    <sw-container
        columns="1fr 1fr"
        gap="0px 32px"
    >
        {% block sw_product_price_form_pack_unit_field %}
        <sw-inherit-wrapper
            v-show="showSettingPackaging"
            v-model:value="product.packUnit"
            :has-parent="!!parentProduct.id"
            :inherited-value="parentProduct.packUnit"
        >
            <template #content="props">

                <mt-text-field
                    class="sw-product-packaging-form__pack-unit-field"
                    :is-inheritance-field="props.isInheritField"
                    :is-inherited="props.isInherited"
                    :error="productPackUnitError"
                    :label="$tc('sw-product.priceForm.labelPackUnit')"
                    :placeholder="$tc('sw-product.packagingForm.placeholderPackagingUnit')"
                    :disabled="props.isInherited || !allowEdit"
                    :help-text="$tc('sw-product.packagingForm.helpTextPackUnit')"
                    :model-value="props.currentValue"
                    @update:model-value="props.updateCurrentValue"
                    @inheritance-restore="props.restoreInheritance"
                    @inheritance-remove="props.removeInheritance"
                />

            </template>
        </sw-inherit-wrapper>
        {% endblock %}

        {% block sw_product_price_form_pack_unit_plural_field %}
        <sw-inherit-wrapper
            v-show="showSettingPackaging"
            v-model:value="product.packUnitPlural"
            :has-parent="!!parentProduct.id"
            :inherited-value="parentProduct.packUnitPlural"
        >
            <template #content="props">

                <mt-text-field
                    class="sw-product-packaging-form__pack-unit-plural-field"
                    :is-inheritance-field="props.isInheritField"
                    :is-inherited="props.isInherited"
                    :error="productPackUnitPluralError"
                    :label="$tc('sw-product.priceForm.labelPackUnitPlural')"
                    :placeholder="$tc('sw-product.packagingForm.placeholderPackagingUnitPlural')"
                    :disabled="props.isInherited || !allowEdit"
                    :help-text="$tc('sw-product.packagingForm.helpTextPackUnitPlural')"
                    :model-value="props.currentValue"
                    @update:model-value="props.updateCurrentValue"
                    @inheritance-restore="props.restoreInheritance"
                    @inheritance-remove="props.removeInheritance"
                />

            </template>
        </sw-inherit-wrapper>
        {% endblock %}
    </sw-container>
</div>
{% endblock %}
